home *** CD-ROM | disk | FTP | other *** search
/ XML Bible (2nd Edition) / XML_Bible_Second_Edition_Hungry_Minds_2001.iso / mac / source / 26 / My VML House_files / script.js < prev    next >
Text File  |  2001-02-17  |  4KB  |  122 lines

  1.  
  2. function LoadSld( slideId )
  3. {
  4.     if( !g_supportsPPTHTML ) return
  5.     if( slideId )
  6.         parent.SldUpdated(slideId)
  7.     g_origSz=parseInt(SlideObj.style.fontSize)
  8.     g_origH=SlideObj.style.posHeight
  9.     g_origW=SlideObj.style.posWidth
  10.     g_scaleHyperlinks=(document.all.tags("AREA").length>0)
  11.     if( g_scaleHyperlinks )
  12.         InitHLinkArray()
  13.     if( g_scaleInFrame||(IsWin("PPTSld") && parent.IsFullScrMode() ) )
  14.         document.body.scroll="no"
  15.     _RSW()
  16.     if( IsWin("PPTSld") && parent.IsFullScrMode() )    {
  17.         document.oncontextmenu=parent._CM;
  18.         self.focus()
  19.     }
  20. }
  21. function MakeSldVis( fTrans ) 
  22. {
  23.     fTrans=fTrans && g_showAnimation
  24.     if( fTrans )
  25.     {
  26.         if( g_bgSound ) {
  27.             idx=g_bgSound.indexOf(",");
  28.             pptSound.src=g_bgSound.substr( 0, idx );
  29.             pptSound.loop= -(parseInt(g_bgSound.substr(idx+1)));
  30.         }
  31.         SlideObj.filters.revealtrans.Apply()
  32.     }
  33.     SlideObj.style.visibility="visible"
  34.     if( fTrans )
  35.         SlideObj.filters.revealtrans.Play()
  36. }
  37. function MakeNotesVis() 
  38. {
  39.     if( !IsNts() ) return false 
  40.     SlideObj.style.display="none"
  41.     nObj = document.all.item("NotesObj")
  42.     parent.SetHasNts(0)
  43.     if( nObj ) { 
  44.         nObj.style.display=""
  45.         parent.SetHasNts(1)
  46.     }
  47.     return 1
  48. }
  49. function Redirect( frmId,sId )
  50. {
  51.     var str=document.location.hash,idx=str.indexOf('#')
  52.     if(idx>=0) str=str.substr(1);
  53.     if( window.name != frmId && ( sId != str) ) {
  54.         obj = document.all.item("Main-File")
  55.         window.location.href=obj.href+"#"+sId
  56.         return 1
  57.     }
  58.     return 0
  59. }
  60. function HideMenu() { if( frames["PPTSld"] && PPTSld.document.all.item("ctxtmenu") && PPTSld.ctxtmenu.style.display!="none" ) { PPTSld.ctxtmenu.style.display='none'; return true } return false }
  61. function IsWin( name ) { return window.name == name }
  62. function IsNts() { return IsWin("PPTNts") }
  63. function IsSldOrNts() { return( IsWin("PPTSld")||IsWin("PPTNts") ) }
  64. function SupportsPPTAnimation() { return( navigator.platform == "Win32" && navigator.appVersion.indexOf("Windows")>0 ) }
  65. function SupportsPPTHTML()
  66. {
  67.     var appVer=navigator.appVersion, msie=appVer.indexOf("MSIE "), ver=0
  68.     if( msie >= 0 )
  69.         ver=parseFloat( appVer.substring( msie+5, appVer.indexOf(";",msie) ) )
  70.     else
  71.         ver=parseInt(appVer)
  72.  
  73.     return( ver >= 4 && msie >= 0 )
  74. }
  75. var MHTMLPrefix = CalculateMHTMLPrefix(); 
  76. function CalculateMHTMLPrefix()
  77. {
  78.     if ( document.location.protocol == 'mhtml:') { 
  79.         href=new String(document.location.href) 
  80.         Start=href.indexOf('!')+1 
  81.         End=href.lastIndexOf('/')+1 
  82.         if (End < Start) 
  83.             return href.substring(0, Start) 
  84.         else 
  85.         return href.substring(0, End) 
  86.     }
  87.     return '';
  88. }
  89.  
  90. function _RSW()
  91. {
  92.     if( !g_supportsPPTHTML || IsNts() ||
  93.       ( !g_scaleInFrame && (( window.name != "PPTSld" ) || !parent.IsFullScrMode()) ) )
  94.         return
  95.  
  96.     cltWidth=document.body.clientWidth
  97.     cltHeight=document.body.clientHeight
  98.     factor=(1.0*cltWidth)/g_origW
  99.     if( cltHeight < g_origH*factor )
  100.         factor=(1.0*cltHeight)/g_origH
  101.  
  102.     newSize = g_origSz * factor
  103.     if( newSize < 1 ) newSize=1
  104.  
  105.     s=SlideObj.style
  106.     s.fontSize=newSize+"px"
  107.     s.posWidth=g_origW*factor
  108.     s.posHeight=g_origH*factor
  109.     s.posLeft=(cltWidth-s.posWidth)/2
  110.     s.posTop=(cltHeight-s.posHeight)/2
  111.  
  112.     if( g_scaleHyperlinks )
  113.         ScaleHyperlinks( factor )
  114. }
  115.  
  116.  
  117. var g_supportsPPTHTML = SupportsPPTHTML(), g_scaleInFrame = true, gId="", g_bgSound="",
  118.     g_scaleHyperlinks = false, g_allowAdvOnClick = true, g_showInBrowser = false;
  119. var g_showAnimation = g_supportsPPTHTML && SupportsPPTAnimation() && g_showInBrowser;
  120. var g_hasTrans = false, g_autoTrans = false, g_transSecs = 0;
  121. var g_animManager = null;
  122.